  function loadUpdateChunk(chunkId, updatedModulesList) {
    return new Promise( <%- basicFunction("resolve, reject")  %> {
      // start update chunk loading
      var url = <%- PUBLIC_PATH %> +<%- GET_CHUNK_UPDATE_SCRIPT_FILENAME %>(chunkId);
      var onResolve = <%- basicFunction("obj") %> {
        var updatedModules = obj.<%- _modules %>;
        var updatedRuntime = obj.<%- _runtime %>;
        if (updatedRuntime) currentUpdateRuntime.push(updatedRuntime);
        for (var moduleId in updatedModules) {
          if ((<%- HAS_OWN_PROPERTY %>)(updatedModules, moduleId)) {
            currentUpdate[moduleId] = updatedModules[moduleId];
            if (updatedModulesList) updatedModulesList.push(moduleId);
          }
        }
        resolve(obj);
      };
      var onReject = <%- basicFunction("error") %> {
        var errorMsg = error.message || "unknown reason";
        error.message = "Loading hot update chunk " + chunkId + " failed.\n(" + errorMsg + ")";
        error.name = "ChunkLoadError";
        reject(error);
      };
      var loadScript = <%- basicFunction("url, onResolve, onReject") %> {
        return <%- _import_function_name %>(/* webpackIgnore: true */ url).then(onResolve).catch(onReject);
      };
      loadScript(url, onResolve, onReject);
    }
    );
  }
